package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PersonOtherInfoMapper;
import com.ruoyi.system.domain.PersonOtherInfo;
import com.ruoyi.system.service.IPersonOtherInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 其余相关信息Service业务层处理
 * 
 * @author TYF
 * @date 2023-08-12
 */
@Service
public class PersonOtherInfoServiceImpl implements IPersonOtherInfoService 
{
    @Autowired
    private PersonOtherInfoMapper personOtherInfoMapper;

    /**
     * 查询其余相关信息
     * 
     * @param id 其余相关信息主键
     * @return 其余相关信息
     */
    @Override
    public PersonOtherInfo selectPersonOtherInfoById(Long id)
    {
        return personOtherInfoMapper.selectPersonOtherInfoById(id);
    }




    @Override
    public List<PersonOtherInfo> selectPersonOtherInfoNotInBaseList(PersonOtherInfo personOtherInfo) {
        return personOtherInfoMapper.selectPersonOtherInfoNotInBaseList(personOtherInfo);
    }

    @Override
    public List<PersonOtherInfo> selectPersonOtherInfoInBaseList(PersonOtherInfo personOtherInfo) {
        return personOtherInfoMapper.selectPersonOtherInfoInBaseList(personOtherInfo);
    }


    @Override
    public List<PersonOtherInfo> selectPersonOtherInfoBaseList(PersonOtherInfo personOtherInfo) {
       return personOtherInfoMapper.selectPersonOtherInfoBaseList(personOtherInfo);
    }

    /**
     * 新增其余相关信息
     * 
     * @param personOtherInfo 其余相关信息
     * @return 结果
     */
    @Override
    public int insertPersonOtherInfo(PersonOtherInfo personOtherInfo)
    {
        personOtherInfo.setCreateTime(DateUtils.getNowDate());
        personOtherInfo.setCreateBy(String.valueOf(ShiroUtils.getSysUser().getUserId()));
        personOtherInfo.setId(System.currentTimeMillis());
        return personOtherInfoMapper.insertPersonOtherInfo(personOtherInfo);
    }

    /**
     * 修改其余相关信息
     * 
     * @param personOtherInfo 其余相关信息
     * @return 结果
     */
    @Override
    public int updatePersonOtherInfo(PersonOtherInfo personOtherInfo)
    {
        personOtherInfo.setUpdateTime(DateUtils.getNowDate());
        personOtherInfo.setUpdateBy(String.valueOf(ShiroUtils.getSysUser().getUserId()));
        return personOtherInfoMapper.updatePersonOtherInfo(personOtherInfo);
    }

    /**
     * 批量删除其余相关信息
     * 
     * @param ids 需要删除的其余相关信息主键
     * @return 结果
     */
    @Override
    public int deletePersonOtherInfoByIds(String ids)
    {
        return personOtherInfoMapper.deletePersonOtherInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除其余相关信息信息
     * 
     * @param id 其余相关信息主键
     * @return 结果
     */
    @Override
    public int deletePersonOtherInfoById(Long id)
    {
        return personOtherInfoMapper.deletePersonOtherInfoById(id);
    }
}
